
--[[

    slimui - Copyright (c) 2011 atom0s, All rights reserved.

    See Copyright notice in slimui.lua
    
]]--

class 'WinControl: Control' { ... };

----------------------------------------------------------------------------------
-- func: WinControl.__init__
-- desc: Constructor called when this object is first created.
----------------------------------------------------------------------------------
function WinControl.__init__( self )
    Control.__init__( self );
end

----------------------------------------------------------------------------------
-- func: WinControl:ControlCount
-- desc: Returns the number of controls the given object has.
----------------------------------------------------------------------------------
function WinControl:ControlCount( )
    return wincontrol_getControlCount( self._object );
end

----------------------------------------------------------------------------------
-- func: WinControl:Controls
-- desc: Returns the control at the given index.
----------------------------------------------------------------------------------
function WinControl:Controls( index )
    return wincontrol_getControl( self._object, index );
end

----------------------------------------------------------------------------------
-- func: WinControl:CanFocus
-- desc: Returns whether this control can obtain focus or not.
----------------------------------------------------------------------------------
function WinControl:CanFocus( )
    return wincontrol_canFocus( self._object );
end

----------------------------------------------------------------------------------
-- func: WinControl:GetFocus
-- desc: Returns whether or not this control has focus.
----------------------------------------------------------------------------------
function WinControl:GetFocus( )
    return wincontrol_focused( self._object );
end

----------------------------------------------------------------------------------
-- func: WinControl:SetFocus
-- desc: Sets the focus to this control.
----------------------------------------------------------------------------------
function WinControl:SetFocus( focus )
    wincontrol_setFocus( self._object, focus );
end

----------------------------------------------------------------------------------
-- func: WinControl:OnEnter
-- desc: Sets this controls OnEnter event handler.
----------------------------------------------------------------------------------
function WinControl:OnEnter( func )
    wincontrol_onEnter( self._object, func );
end

----------------------------------------------------------------------------------
-- func: WinControl:OnExit
-- desc: Sets this controls OnExit event handler.
----------------------------------------------------------------------------------
function WinControl:OnExit( func )
    wincontrol_onExit( self._object, func );
end




--[[ Debug information. ]]--------------------------------------------------------
if ( slimui:isdebug() == true ) then
    slimui:msg( '(Base) wincontrol.lua successfully loaded.' );
end